// 路由检权组件

import { getToken } from "@/utils/index.jsx";
import { Navigate } from "react-router-dom";

export default function AuthRoute({ children }) {
  // 取token
  let token = getToken();
  if (token) {
    return <>{ children }</>
  } else {
    // 重定向
    return <Navigate to={'/login'} replace />
  }
}